var utils = {
    baseUrl: "",
    imgUrl:"http://127.0.0.1:8888/resource/",
//从session 中获取数据
    getSession: function (key) {
        var data = sessionStorage.getItem(key);
        return data;
    },

    setCookie: function (name, value) {
        var Days = 30;
        var exp = new Date();
        exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
        document.cookie = name + "=" + escape(value);
    },
    getCookie: function (name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg))
            return unescape(arr[2]);
        else
            return null;
    },

    removeCookie: function (key, val) {
        utils.setCookie(key, val, -1)
    }
}
